package control;

import java.util.HashMap;

import javax.media.opengl.GL;

import model.SimpleObjFile;

public class ModelsManager {

	private HashMap<Integer, SimpleObjFile> models;
	private static String loc = System.getProperty("user.dir");
	
	public int CRYSTAL1_MODEL = 0;
	public int CRYSTAL2_MODEL = 1;
	public int GEOSPHERE = 2;
	public int CIRCLE = 3;
	public int PIPE = 4;
	public int EMERALD = 5;
	
	public ModelsManager() {
		models = new HashMap<Integer, SimpleObjFile>();
		loadModels();
	}

	public void loadModels() {
		models.put(CRYSTAL1_MODEL, SimpleObjFile.getFromFile(loc + "/resources/models/crystal.obj"));
		models.put(CRYSTAL2_MODEL, SimpleObjFile.getFromFile(loc + "/resources/models/crystal2.obj"));
		models.put(GEOSPHERE, SimpleObjFile.getFromFile(loc + "/resources/models/geosphere.obj"));
		models.put(CIRCLE, SimpleObjFile.getFromFile(loc + "/resources/models/circle.obj"));

	}
	
	public void drawModel(GL gl, int model) {
		SimpleObjFile file = models.get(model);
		file.draw(gl);
	}

}
